const mongoose = require('mongoose');
const {DB_URL} = require('../config');
const logger = require('../logger');
(async function connectToMongodb(){
    try{
        await mongoose.connect(DB_URL)
        logger.info(`Mongodb连接成功`)
    }catch(error){
        logger.error(`Mongodb连接失败`+error.message)
    }
})()